﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace MagicFight
{
    public class FieldProtection : Magic
    {
        int duration = Def.FieldProtectionDef.Duration;
        int radius = Def.FieldProtectionDef.radius;
        public float multiplier = Def.FieldProtectionDef.Multiplier;

        Vector2 position;

        public FieldProtection(Character caster)
            : base(caster, Def.FieldProtectionDef.N)
        {
            this.position = caster.position;
            //ps.effectsManager.Add(new HolyAura(this)); 
        }

        public override void Effect(GameTime gameTime)
        {
            // O efeito desta magia está em Character.TakeDamage()
            if (!alive || lifeTime > duration) { alive = false; return; }
        }

        public bool CollidesWith(Character c)
        {
            return (Vector2.Distance(this.position, c.position) < this.radius + c.radius);
        }
    }
}
